package com.iocup.keybastion.authentication.userdetails.service;


import com.iocup.keybastion.authentication.userdetails.UserDetails;

/**
 *  用户信息获取服务：这个是集成jar包时必须实现的类
 * @author xyjxust
 * @create 2021/11/25
 **/
public class MockUserDetailServiceImpl implements UserDetailService  {

    private UserDetails userDetails;

    public MockUserDetailServiceImpl(UserDetails userDetails){
        this.userDetails = userDetails;
    }

    @Override
    public UserDetails loadUserByUsername(String userName) {
        if(userName.equals(userDetails.getLoginName())){
            return userDetails;
        }
        return null;
    }
}
